import { setStorage, getStorage, clearStorage } from './storage'
import { storeCommit } from './store'

/**
 * 登录失效
 */
export function tokenDisabled() {
  storeCommit('loginOut', '登录失效')
}

/**
 * 获取用户Token
 * @returns token
 */
export function getToken() {
  return getStorage('aha_token') || ''
}

/**
 * 设置用户token
 * @param {String} token
 */
export function setToken(token:string) {
  setStorage('aha_token', token)
}

/**
 * 清除用户token
 */
export function clearToken() {
  clearStorage('aha_token')
}

